home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / VD08BIN.ZIP / usr / include / util / simplelist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-13  |  1.7 KB  |  69 lines

  1. /* -------------------------------------------------------------------
  2.  
  3.     Project: General utility classes
  4.  
  5.     Objective-C interface file for the class SimpleList
  6.  
  7.     COPYRIGHT (C), 1995, Thomas Baier
  8.     ALL RIGHTS RESERVED.
  9.  
  10.     Date:                Rev: 0.1
  11.     1995-Jul-27            ___
  12.  
  13.  */
  14.  
  15. #ifndef _SIMPLELIST_H_
  16. #define _SIMPLELIST_H_
  17.  
  18. #ifndef INVALID_INDEX
  19. #define INVALID_INDEX (unsigned long) -1
  20. #endif
  21.  
  22. /*====================================================================
  23.                     Interface of class SimpleList                     
  24. ====================================================================*/
  25. #include <objc/Object.h>
  26.  
  27. @interface SimpleList : Object
  28. {
  29.   id *data;
  30.  
  31.   unsigned long count;
  32.   unsigned long maxCount;
  33.  
  34.   unsigned long slots;
  35. }
  36.  
  37. /* -------------------------- Initialize -------------------------- */
  38. -init;
  39. -initCount: (unsigned long) aCount;
  40.  
  41. /* ----------------------------- Free ----------------------------- */
  42. -free;
  43. -freeObjects;
  44.  
  45. /* ----------- Methods for access to Instance Variables ----------- */
  46. -(unsigned long) count;
  47.  
  48. /* ------------------------ Public methods ------------------------ */
  49. -addObject: anObject;
  50. -appendList: (SimpleList *) otherList;
  51. -empty;
  52. -insertObject: anObject at: (unsigned long) position;
  53. -lastObject;
  54. -objectAt: (unsigned long) position;
  55. -(unsigned long) indexOf: anObject;
  56. -removeLastObject;
  57. -removeObjectAt: (unsigned long) position;
  58. -replaceObjectAt: (unsigned long) position with: anObject;
  59.  
  60. /* ----------------------- Private methods ------------------------ */
  61.  
  62. /* ---------------------- Archiving methods ----------------------- */
  63. -read: (TypedStream *) aStream;
  64. -write: (TypedStream *) aStream;
  65.  
  66. @end
  67.  
  68. #endif
  69.